<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const str = "css,html,js"; // ['css','html','js']
      const arr = [];
      let box = "";
      for (let i = 0; i < str.length; i++) {
        if (str[i] !== ",") box += str[i];
        if (str[i] === "," || i === str.length - 1) {
          arr.push(box);
          box = "";
        }
      }
      console.log(arr);
    </script>
  </body>
</html>
